extern long allofit(long,long,long,long,long,long,long,long,long,long,long,long);
long errors=0;

long vals[]={123,456,-789,-999999,666,69,42,-21,13371337,-69696969};
long inds[]={8,3,4,7,0,2,1,5,9,6,-8,-3,-4,-7,-0,-2,-1,-5,-9,-6};
long vvals[]={123,456,-789,-999999,666,69,42,-21,13371337,-69696969};
long iinds[]={8,3,4,7,0,2,1,5,9,6,-8,-3,-4,-7,-0,-2,-1,-5,-9,-6};

for (int i=0; i<10; i++) {
	for (int j=0; j<10; j++) {
		for (int k=0; k<10; k++) {
			for (int l=0; l<10; l++) {
				long a = i;
				long b = -j; 
				long c = i/2; 
				long d = 7-j/2; 
				long e = k; 
				long f = -l; 
				long g = k/2+3; 
				long h = 9-l/2; 
				long expected = 1
+(2*((-vals[inds[a]])+(vals[-inds[a+10]])+(vals[inds[-b]])))
+(3*((-vvals[inds[a]])+(vvals[-inds[a+10]])+(vvals[inds[-b]])))
+(4*((-vals[iinds[a]])+(vals[-iinds[a+10]])+(vals[iinds[-b]])))
+(5*((-vvals[iinds[a]])+(vvals[-iinds[a+10]])+(vvals[iinds[-b]])))
+(6*((-vals[inds[e]])+(vals[-inds[e+10]])+(vals[inds[-f]])))
+(7*((-vvals[inds[e]])+(vvals[-inds[e+10]])+(vvals[inds[-f]])))
+(8*((-vals[iinds[e]])+(vals[-iinds[e+10]])+(vals[iinds[-f]])))
+(9*((-vvals[iinds[e]])+(vvals[-iinds[e+10]])+(vvals[iinds[-b]])))
+(10*((vvals[a]*10*11*vals[e])+(-((vals[a]*2*vvals[e])+(vvals[a]*2*vals[e])))+(4*vals[a]*vvals[e]*5)))
+(a*b*2*3*c*d*vals[a]*vvals[e]*e*f*g*h);
				long result = allofit((long)vals,(long)inds,a,b,c,d,(long)vals,(long)inds,e,f,g,h);
				if (expected!=result) {
					//fprintf(stderr,"Expected: %ld, Result: %ld\n",expected,result);
					errors++;
				}
			}
		}
	}
}
printf("Total Errors: %ld\n",errors);
RET(errors==0);
